package com.dkd.web.core.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MinioConfig {
    @Bean
    public MinioClient minioClient(@Value("${dromara.x-file-storage.minio[0].end-point}") String endpoint,
                                   @Value("${dromara.x-file-storage.minio[0].access-key}") String ak,
                                   @Value("${dromara.x-file-storage.minio[0].secret-key}") String sk) {
        return MinioClient.builder()
                .endpoint(endpoint)
                .credentials(ak, sk)
                .build();
    }
}